﻿using LmgCMS.Model;
using LmgCMS.Service;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Swagger;
using System.Text;
namespace LmgCMS.Areas.API.Controllers
{
    /// <summary>
    /// 站点管理
    /// </summary>
    [ApiExplorerSettings(GroupName = SwaggerGroupingModel.GROUPNAME_COMM)]
    public class SiteController : BaseController<Site>
    {
        private readonly ISiteService _siteService;
        public SiteController(ISiteService siteService)
        {
            _siteService = siteService;
        }


        [HttpGet]
        public IActionResult GetCurrSite(string SiteUrl)
        {
            var model = _siteService.Find(x =>x.SiteUrl== SiteUrl && x.Status == 1);
            return Content(model.ToJson());
        }
    }
}
